import { axiosGetUserTaskList } from "@/api/home";
let status = {
  "1": {
    icon: "icon-putongzhuangtai",
    color: "#e73b44"
  },
  // icon-wanchenglei
  "2": {
    icon: "icon-wanchenglei",
    color: "#008200"
  }
};
export default {
  data () {
    return {
      status: status,
      columnData: [
        { prop: "name", label: "任务名称" },
        { prop: "type", label: "流程类型" },
        { prop: "state", label: "任务状态", isTemplate: true },
        { prop: "authorNo", label: "负责人" },
        { prop: "receiveTime", label: "接受时间" }
      ],
      tableData: [],
      isLoading: true
    };
  },
  methods: {
    changStatusFun (status) {
      return this.status[status];
    },
    getTaskListDataFun (params) {
      axiosGetUserTaskList(params).then(res => {
        if (res.status === 200) {
          if (res.data.code === 0) {
            this.tableData = res.data.data.records;
          }
        }
        this.isLoading = false;
        this.$emit("tableMount", { data: this.tableData, name: this.name });
      });
    }
  },
  mounted () {
    this.$nextTick(() => {
      this.getTaskListDataFun(this.params);
    });
  }
};